package liurong.driver.guava;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

public class BloomFilterTest {
	public static void main(String[] args) {
		BloomFilter<Integer> bloomFilter = BloomFilter.create(Funnels.integerFunnel(), 10);

		bloomFilter.put(1);
		bloomFilter.put(2);

		System.out.println(bloomFilter.mightContain(2));
		System.out.println(bloomFilter.mightContain(2));
		System.out.println(bloomFilter.mightContain(2));
		System.out.println(bloomFilter.mightContain(2));
		System.out.println(bloomFilter.mightContain(2));
		System.out.println(bloomFilter.mightContain(0));
		System.out.println(bloomFilter.mightContain(0));
		System.out.println(bloomFilter.mightContain(0));
		System.out.println(bloomFilter.mightContain(0));
	}
}
